package _interview75;

/**
 * 334. 递增的三元子序列
 */
public class No334 {
    /**
     * 2. 贪心
     */
    public boolean increasingTriplet2(int[] nums) {
        int first = nums[0], second = Integer.MAX_VALUE;
        for (int i = 1; i < nums.length; i++) {
            int num = nums[i];
            if (num > second) return true;
            else if (num > first) second = num;
            else if (num < first) first = num;
        }
        return false;
    }
}
